package com.yonyou.pmclouds.plan.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.yonyou.pmclouds.basecom.entity.SuperVO;
import lombok.Data;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;
import java.util.Date;

@Data
@Table(name = "pm_plan_templet")
public class PlanTempletVO extends SuperVO {

    public static final String PK_PLAN_TEMPLET = "pkPlanTemplet";
    public static final String DEPEND_TEMPLET = "dependTemplet";
    public static final String CHILD_COUNT = "childCount";
    public static final String TYPE = "type";
    public static final String CREATOR = "creator";
    public static final String CREATOR_NAME = "creatorName";
    public static final String EXPECT_DURATION = "expectDuration";
    public static final String RELATED_BILL_TYPE = "relatedBillType";
    public static final String MANAGER = "manager";
    public static final String MANAGER_NAME = "managerName";
    public static final String PK_MILESTONE = "pkMilestone";
    public static final String PK_DEPARTMENT = "pkDepartment";

    @Id
    @NotNull(groups = PlanTempletVO.UpdateValid.class)
    private String pkPlanTemplet;

    private String pkTenant;

    @Excel(name = "计划编码")
    private String scode;
    @NotNull
    @Excel(name = "计划名称")
    private String sname;

    /**
     * 里程碑
     */
    private String pkMilestone;
    @Excel(name = "里程碑编码")
    @Transient
    private String milestoneCode;
    @Transient
    private String milestoneName;
    /**
     * 工期
     */
    @Excel(name = "工期（d）")
    private Integer expectDuration;
    /**
     * 关联单据
     */
    private String relatedBillType;
    @Transient
    private String relatedBillTypeName;
    /**
     * 负责人
     */
    private String manager;
    @Transient
    private String managerName;
    /**
     * 计划类型，现在为项目类型参照
     */
    private String type;
    /**
     * 前置计划
     */
    private String dependTemplet;

    /**
     * 组织
     */
    private String pkOrg;
    /**
     * 部门
     */
    private String pkDepartment;

    /**
     * 前置计划名称
     */
    @Transient
    @Excel(name = "前置计划")
    private String dependPlanName;

    private String pkParent;

    private String pkRoot;

    private Integer childCount;
    /**
     * 来源
     */
    private String source;
    private String creator;
    private Date creationtime;
    private String modifier;
    private Date modifytime;

    @Transient
    private String creatorName;
    @Transient
    private PlanTempletVO[] children;
    @Transient
    private String[] deletePlan;
    @Transient
    private String key;
    @Transient
    private String orgName;
    @Transient
    private String typeName;
    @Transient
    private String departmentName;


    public interface UpdateValid {
    }

    public interface InsertValid {
    }
}